home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 59193 / 59193.xpi / chrome / manman89grablink.jar / content / firefoxOverlay.xul < prev    next >
Extensible Markup Language  |  2010-01-14  |  3KB  |  73 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE overlay SYSTEM "chrome://manman89grablink/locale/manman89grablink.dtd">
  3. <overlay id="manman89grablink-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  4. <script src="overlay.js"/>
  5. <script type="application/x-javascript">
  6. <![CDATA[
  7. window.addEventListener("load",manman89grablinkInit,false);
  8.  
  9. function manman89grablinkInit() {
  10.         var menu = document.getElementById("contentAreaContextMenu");
  11.         menu.addEventListener("popupshowing", manman89grablinkShowHide, false);
  12.         manman89grablink.set_menu_event('context-manman89grablink', 'manman89grablink.upload_selected()');
  13. }
  14.  
  15. function manman89grablinkShowHide() {
  16.     if (gContextMenu)
  17.     {
  18.         var isTextSelected = false;
  19.         
  20.         var node = document.commandDispatcher.focusedElement;    
  21.         if (node == undefined || node == null){
  22.             isTextSelected = gContextMenu.isTextSelected;
  23.         }else{
  24.             var nodeLocalName = node.localName.toUpperCase();    
  25.             if ((nodeLocalName == "TEXTAREA") || (nodeLocalName == "INPUT" && (node.type.toUpperCase() == "TEXT" || node.type.toUpperCase() == "FILE")) || nodeLocalName == "TEXTBOX" ) {                
  26.                 isTextSelected = true;
  27.             }
  28.         }
  29.         
  30.         var manman89grablinkMenu = document.getElementById('context-manman89grablink');
  31.         if(isTextSelected){
  32.             manman89grablink.set_menu_event('manman89grablink.upload_selected()');
  33.             manman89grablink.set_menu_caption(' COPY TEXT FROM SELECTED TEXT');
  34.             
  35.             document.getElementById('context-manman89grablink1').style.display="block";
  36.             document.getElementById('context-manman89grablink2').style.display="none";
  37.             
  38.         }else
  39.         {
  40.             document.getElementById('context-manman89grablink1').style.display="none";
  41.             document.getElementById('context-manman89grablink2').style.display="block";
  42.             
  43.             manman89grablink.set_menu_event("manman89grablink.go_to_site('http://www.vn-new.com')");
  44.             manman89grablink.set_menu_caption(' SCAN LINK - GO TO VN-NEW.COM');
  45.         }
  46.     }
  47. }
  48. ]]>
  49.  
  50. </script>
  51.  
  52.   <popup id="contentAreaContextMenu">
  53.     <menuitem id="context-manman89grablink" label="&manman89grablink.label;"
  54.               accesskey="&manman89grablinkContext.accesskey;"
  55.               insertafter="context-stop"
  56.               class="menuitem-iconic"
  57.               image="chrome://manman89grablink/content/manman89grablink_small.png"/>
  58.     <menuitem id="context-manman89grablink1" label=" COPY ALL LINK FROM SELECTED TEXT"
  59.               accesskey="c"
  60.               insertafter="context-stop"
  61.               class="menuitem-iconic"
  62.               oncommand="manman89grablink.OnCommand('sel')"
  63.               image="chrome://manman89grablink/content/manman89grablink_small.png"/>
  64.     <menuitem id="context-manman89grablink2" label=" COPY ALL LINK FROM CURRENT PAGE"
  65.               accesskey="c"
  66.               insertafter="context-stop"
  67.               class="menuitem-iconic"
  68.               oncommand="manman89grablink.OnCommand('all')"
  69.               image="chrome://manman89grablink/content/manman89grablink_small.png"/>
  70.   </popup>
  71.   
  72. </overlay>
  73.